From 9f0d43fe099a95ab1516ae951dcb60a89e76a5a5 Mon Sep 17 00:00:00 2001
From: 简律纯 <i@jyunko.cn>
Date: Fri, 3 Nov 2023 21:13:33 +0800
Subject: chore: delete useless codes

---
 docs/pages/api/user/[id].tsx | 36 ------------------------------------
 1 file changed, 36 deletions(-)
 delete mode 100644 docs/pages/api/user/[id].tsx

(limited to 'docs/pages/api/user/[id].tsx')

diff --git a/docs/pages/api/user/[id].tsx b/docs/pages/api/user/[id].tsx
deleted file mode 100644
index 091d716..0000000
--- a/docs/pages/api/user/[id].tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { NextApiRequest, NextApiResponse } from "next";
-import { withSentry } from "@sentry/nextjs";
-import {
-  getSubscriber,
-  Subscriber,
-  updateSubscriber,
-} from "../../../lib/ConvertKitApi";
-
-async function handler(req: NextApiRequest, res: NextApiResponse) {
-  try {
-    if (req.method === "PUT") {
-      const subscriber = await updateSubscriber(
-        req.query.id as string,
-        {
-          first_name: req.body.first_name,
-          email_address: req.body.email_address,
-          fields: req.body.fields,
-        } as Subscriber
-      );
-      res.setHeader("Content-Type", "application/json");
-      res.statusCode = 204;
-      res.json(subscriber);
-    } else {
-      const subscriber = await getSubscriber(req.query.id as string);
-      res.setHeader("Content-Type", "application/json");
-      res.statusCode = 200;
-      res.json(subscriber);
-    }
-  } catch (error) {
-    console.log(error);
-    res.statusCode = 500;
-    res.json({ okay: false });
-  }
-}
-
-export default withSentry(handler);
-- 
cgit v1.2.3-70-g09d2

